part of 'device_bloc.dart';

enum ConnectStatus { unknow, initial, connected, disConnected }
enum StorageStatus { unknow, inital, config, unConfig }

class DeviceState extends Equatable {
  const DeviceState(
      {this.isConnect = ConnectStatus.unknow,
      this.isStorageConfig = StorageStatus.unknow,
      this.storageId = '',
      this.toolKitId = '',
      this.temperature = '0.0',
      this.humidity = '0.0',
      this.antennaList = const <AntennaData>[],  //射频端口
      this.operateType = 0, //操作类型
      this.readFinish = false, //是否读取完成
      this.isReading = false,
      this.storageName = '',
      this.message = '',
      this.showForceOperationButton = false,
      this.handleList = const <String>[],
      this.collectList = const <String>[],
      this.socketConnectStatus = ConnectStatus.initial,
      this.notice = '',
      this.heatStatus = false,
      this.dehumidifyStatus = false,
      this.exhaustStatus = false,
      this.airConStatus = false,
      this.autoStatus = false,
      this.alarmStatus = false,
      this.airCleanStatus = false});

  final bool showForceOperationButton;
  final String storageName;
  final bool readFinish;
  final ConnectStatus isConnect;
  final ConnectStatus socketConnectStatus;
  final List<String> handleList;
  final StorageStatus isStorageConfig;
  final List<String> collectList;
  final String storageId;
  final String toolKitId;
  final String temperature;
  final String humidity;
  final bool isReading;
  final int operateType;
  final List<AntennaData> antennaList;
  final String message;
  final String notice;
  final bool heatStatus;
  final bool dehumidifyStatus;
  final bool exhaustStatus;
  final bool airConStatus;
  final bool autoStatus;
  final bool alarmStatus;
  final bool airCleanStatus;

  @override
  List<Object> get props => [
        isConnect,
        isStorageConfig,
        storageId,
        toolKitId,
        temperature,
        humidity,
        handleList,
        collectList,
        isReading,
        antennaList,
        readFinish,
        message,
        storageName,
        showForceOperationButton,
        socketConnectStatus,
        notice,
        heatStatus,
        dehumidifyStatus,
        exhaustStatus,
        airConStatus,
        autoStatus,
        alarmStatus,
        airCleanStatus,
      ];

  DeviceState copyWith(
      {ConnectStatus? isConnect,
      StorageStatus? isStorageConfig,
      ConnectStatus? socketConnectStatus,
      String? storageId,
      String? toolKitId,
      String? temperature,
      String? humidity,
      bool? isReading,
      bool? readFinish,
      String? storageName,
      int? operateType,
      String? message,
      String? notice,
      bool? heatStatus,
      bool? dehumidifyStatus,
      bool? exhaustStatus,
      bool? airConStatus,
      bool? autoStatus,
      bool? alarmStatus,
      bool? airCleanStatus,
      bool? showForceOperationButton,
      List<AntennaData>? antennaList,
      List<String>? handleList,
      List<String>? collectList}) {
    return DeviceState(
        isConnect: isConnect ?? this.isConnect,
        isStorageConfig: isStorageConfig ?? this.isStorageConfig,
        temperature: temperature ?? this.temperature,
        humidity: humidity ?? this.humidity,
        toolKitId: toolKitId ?? this.toolKitId,
        storageId: storageId ?? this.storageId,
        handleList: handleList ?? this.handleList,
        isReading: isReading ?? this.isReading,
        readFinish: readFinish ?? this.readFinish,
        operateType: operateType ?? this.operateType,
        message: message ?? this.message,
        socketConnectStatus: socketConnectStatus ?? this.socketConnectStatus,
        antennaList: antennaList ?? this.antennaList,
        notice: notice ?? this.notice,
        heatStatus: heatStatus ?? this.heatStatus,
        dehumidifyStatus: dehumidifyStatus ?? this.dehumidifyStatus,
        exhaustStatus: exhaustStatus ?? this.exhaustStatus,
        airConStatus: airConStatus ?? this.airConStatus,
        autoStatus: autoStatus ?? this.autoStatus,
        alarmStatus: alarmStatus ?? this.alarmStatus,
        airCleanStatus: airCleanStatus ?? this.airCleanStatus,
        showForceOperationButton:
            showForceOperationButton ?? this.showForceOperationButton,
        storageName: storageName ?? this.storageName,
        collectList: collectList ?? this.collectList);
  }
}
